package com.jqsoft.launcher.activity.gairui;

import android.content.Intent;

import java.util.List;

/**
 * 本类与ActiveX,控件返回的参数相同
 * 
 * @author Nony
 *
 */
public class EcgData {
	private short[] data;
	
	private int hp;
	private int lp;
	private int notch;

	private float hr;//心率
	private float pAxis;//p轴
	private float qrsAxis;//qrs轴
	private float taxis;//t轴
	private float prInterval;//pr间期
	private float qrsDuration;//qrs间期
	private float qtd;//qt间期
	private float qtc;//qtc间期
	private float rv5;//rv5电压值
	private float sv1;//v1导联的s波
	private float rv5sv1;//rv5+sv1
	private float pWidth;
	private byte pExist;
	
	private int[] resultCodes;
	private List<String> resultText;

	public EcgData() {
	}

	public EcgData(Intent intent) {
		if (intent == null) {
			return;
		}
		
		data = intent.getShortArrayExtra(EcgContent.ECG_DATA);
		
		hp = intent.getIntExtra(EcgContent.ECG_CONF_HP, 0);
		lp = intent.getIntExtra(EcgContent.ECG_CONF_LP, 0);
		notch = intent.getIntExtra(EcgContent.ECG_CONF_NOTCH, 0);
		
		hr = intent.getFloatExtra(EcgContent.ECG_HR, 0);
		pAxis = intent.getFloatExtra(EcgContent.ECG_P_AXIS, 0);
		qrsAxis = intent.getFloatExtra(EcgContent.ECG_QRS_AXIS, 0);
		taxis = intent.getFloatExtra(EcgContent.ECG_T_AXIS, 0);
		prInterval = intent.getFloatExtra(EcgContent.ECG_PR_INTERVAL, 0);
		qrsDuration = intent.getFloatExtra(EcgContent.ECG_QRS_DURATION, 0);
		qtd = intent.getFloatExtra(EcgContent.ECG_QTD, 0);
		qtc = intent.getFloatExtra(EcgContent.ECG_QTC, 0);
		rv5 = intent.getFloatExtra(EcgContent.ECG_RV5, 0);
		sv1 = intent.getFloatExtra(EcgContent.ECG_SV1, 0);
		rv5sv1 = intent.getFloatExtra(EcgContent.ECG_RV5_SV1, 0);
		pWidth = intent.getFloatExtra(EcgContent.ECG_P_WIDTH, 0);
		pExist = intent.getByteExtra(EcgContent.ECG_P_EXIST, (byte)0x00);
		
		resultCodes = intent.getIntArrayExtra(EcgContent.ECG_RESULT_CODE);
		resultText = (List<String>) intent.getSerializableExtra(EcgContent.ECG_RESULT_TEXT);
	}
	
	public short[] getData() {
		return data;
	}
	/**
	 * 0: 关闭
	 * 1: 0.05Hz
	 * 2: 0.15Hz
	 * 3: 0.25Hz
	 * 4: 0.50Hz
	 * @return
	 */
	public int getHp() {
		return hp;
	}
	/**
	 * 0: 关闭
	 * 1: 20Hz
	 * 2: 30Hz
	 * 3: 40Hz
	 * @return
	 */
	public int getLp() {
		return lp;
	}
	/**
	 * 0: 关闭
	 * 1: 50Hz
	 * 2: 60Hz
	 * @return
	 */
	public int getNotch() {
		return notch;
	}
	public float getHr() {
		return hr;
	}
	public float getPAxis() {
		return pAxis;
	}
	public float getQrsAxis() {
		return qrsAxis;
	}
	public float getTAxis() {
		return taxis;
	}
	public float getPrInterval() {
		return prInterval;
	}
	public float getQrsDuration() {
		return qrsDuration;
	}
	public float getQtd() {
		return qtd;
	}
	public float getQtc() {
		return qtc;
	}
	/**
	 * 整数,除以1000,使用
	 * @return
	 */
	public float getRv5() {
		return rv5;
	}
	/**
	 * 整数,除以1000,使用
	 * @return
	 */
	public float getSv1() {
		return sv1;
	}
	/**
	 * 整数,除以1000,使用
	 * @return
	 */
	public float getRv5sv1() {
		return rv5sv1;
	}
	public float getPWidth() {
		return pWidth;
	}
	public byte getPExist() {
		return pExist;
	}
	public int[] getResultCodes() {
		return resultCodes;
	}
	public List<String> getResultText() {
		return resultText;
	}

	public void setData(short[] data) {
		this.data = data;
	}

	public void setHp(int hp) {
		this.hp = hp;
	}

	public void setLp(int lp) {
		this.lp = lp;
	}

	public void setNotch(int notch) {
		this.notch = notch;
	}

	public void setHr(float hr) {
		this.hr = hr;
	}

	public void setpAxis(float pAxis) {
		this.pAxis = pAxis;
	}

	public void setQrsAxis(float qrsAxis) {
		this.qrsAxis = qrsAxis;
	}

	public void setTaxis(float taxis) {
		this.taxis = taxis;
	}

	public void setPrInterval(float prInterval) {
		this.prInterval = prInterval;
	}

	public void setQrsDuration(float qrsDuration) {
		this.qrsDuration = qrsDuration;
	}

	public void setQtd(float qtd) {
		this.qtd = qtd;
	}

	public void setQtc(float qtc) {
		this.qtc = qtc;
	}

	public void setRv5(float rv5) {
		this.rv5 = rv5;
	}

	public void setSv1(float sv1) {
		this.sv1 = sv1;
	}

	public void setRv5sv1(float rv5sv1) {
		this.rv5sv1 = rv5sv1;
	}

	public void setpWidth(float pWidth) {
		this.pWidth = pWidth;
	}

	public void setpExist(byte pExist) {
		this.pExist = pExist;
	}

	public void setResultCodes(int[] resultCodes) {
		this.resultCodes = resultCodes;
	}

	public void setResultText(List<String> resultText) {
		this.resultText = resultText;
	}
}
